﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main/Site.Master" AutoEventWireup="true"
    ViewStateMode="Disabled" CodeBehind="EngineRoom.aspx.cs" Inherits="LongSpeed.WebSite.Main.EngineRoom" %>

<%@ OutputCache Duration="420" VaryByParam="mid;pid;pageIndex" NoStore="true" Location="Any" %>
<%@ Register Src="~/UserControl/ucKnowledgeNavigator.ascx" TagName="KnowledgeNavigator"
    TagPrefix="uc" %>
<%@ Register Src="~/UserControl/ucPaymentMode.ascx" TagName="PaymentMode" TagPrefix="uc" %>
<%@ Register Src="~/UserControl/ucBulletin.ascx" TagName="Bulletin" TagPrefix="uc" %>
<%@ Register Src="~/UserControl/ServerTree.ascx" TagName="ServerTree" TagPrefix="uc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        #table, tr, td
        {
            text-align: center;
            font-size: 14px;
            border: solid 1px #99CC66;
        }
        #table th
        {
            background: #669900;
            border-bottom: 1px solid #CCC;
            padding: 0;
            font-size: 16px;
            text-align: center;
            height: 28px;
            color: #CCCCCC;
        }
        #table td a
        {
            color: #009933;
        }
        .submit
        {
            background: url(Images/login.jpg);
            width: 79px;
            height: 72px;
        }
    </style>
</asp:Content>
<asp:Content ID="EngineRoomContent" ContentPlaceHolderID="PlaceHolder" runat="server">
    <div>
        <div class="floatleft">
            <uc:ServerTree ID="ucst" runat="server" />
            <uc:KnowledgeNavigator ID="uckn" runat="server" />
            <uc:PaymentMode ID="ucpm" runat="server" />
        </div>
        <div id="mainarea">
            <div class="sblock2">
                <div class="sblock2-top">
                    <div class="articeltitle" style="background-image: none; width: auto; color: Black;
                        float: none;">
                        <h4 style="font-weight: bold; color: #FF6600;">
                            <%
                                var memuDic = Session[LongSpeed.WebSite.Behaviors.SessionString.MemuStr] as Dictionary<int, LongSpeed.WebSite.Behaviors.Memu>;
                                int parid = Convert.ToInt32(Request.QueryString[LongSpeed.WebSite.Behaviors.SessionString.ParentMemuId]);
                                int mid = Convert.ToInt32(Request.QueryString[LongSpeed.WebSite.Behaviors.SessionString.MemuId]);

                                var m = memuDic[parid].ChildMemu.Where(o => o.ID == mid).Single();

                            %>
                            <%=( m.Name) %></h4>
                    </div>
                </div>
                <div class="sblock2-bottom" id="pgs">
                    <div style="color: #333333; padding: 10px;">
                        <%        
                            LongSpeed.WebSite.Behaviors.ServerConfig sce = new LongSpeed.WebSite.Behaviors.ServerConfig();

                            IList<LongSpeed.WebSite.Behaviors.ServerConfig> datalist = new List<LongSpeed.WebSite.Behaviors.ServerConfig>();

                            //if (Request.QueryString["pageIndex"] != null)
                            //{
                            //    pageIndex = Convert.ToInt32(Request.QueryString["pageIndex"]);
                            //    datalist = sce.GetServersByParentOfPage(m, pageIndex, pageCount, ref sumPageCount);
                            //}
                            //else
                            //{
                            //    pageIndex = 1;
                            //    datalist = sce.GetServersByParentOfPage(m, 1, pageCount, ref sumPageCount);
                            //}

                            datalist = sce.GetServersByParent(m);

                            if (string.IsNullOrEmpty(m.Description))
                            {
                                Response.Write("暂无数据");
                            }
                            else
                            {
                                Response.Write(m.Description);
                            }
                        %>
                    </div>
                </div>
            </div>
            <%
                if (Convert.ToBoolean(m.AlternateField5))
                {
            %>
            <div class="sblock2">
                <div class="sblock2-top">
                    <h4 style="font-weight: bold;">
                        <span style="color: #FF6600;">
                            <%=(m.AlternateField1)%></span>
                    </h4>
                </div>
                <div class="sblock2-bottom" style="color: #333333">
                    <%
                    if (datalist.Count == 0)
                    {
                        Response.Write("暂无数据");
                    }
                    else
                    {
                    %>
                    <table id="table" width="100%" border="0px" align="center">
                        <tr>
                            <th width="90px;">
                                型号
                            </th>
                            <th width="180px;">
                                处理器
                            </th>
                            <th width="45px;">
                                内存
                            </th>
                            <th width="90px;">
                                标准硬盘
                            </th>
                            <th width="80px;">
                                宽带
                            </th>
                            <th width="60px;">
                                月流量
                            </th>
                            <th width="40px;">
                                IP数
                            </th>
                            <th width="70px;">
                                价格(元)
                            </th>
                            <th width="65px;">
                                订购
                            </th>
                        </tr>
                        <%
                        foreach (var item in datalist)
                        {
                        %>
                        <tr>
                            <td>
                                <span title="<%=(item.Name) %>">
                                    <%=(item.Name.Length > 100 ? item.Name.Substring(0, 100) + "…" : item.Name)%>
                                </span>
                            </td>
                            <td>
                                <span title="<%=(item.CPU) %>">
                                    <%=(item.CPU.Length > 100 ? item.CPU.Substring(0, 100) + "…" : item.CPU)%>
                                </span>
                            </td>
                            <td>
                                <span title="<%=(item.RAM) %>">
                                    <%=(item.RAM.Length > 100 ? item.RAM.Substring(0, 100) + "…" : item.RAM)%>
                                </span>
                            </td>
                            <td>
                                <span title="<%=(item.HD) %>">
                                    <%=(item.HD.Length > 100 ? item.HD.Substring(0, 100) + "…" : item.HD)%>
                                </span>
                            </td>
                            <td>
                                <span title="<%=(item.Broadband) %>">
                                    <%=(item.Broadband.Length > 100 ? item.Broadband.Substring(0, 100) + "…" : item.Broadband)%>
                                </span>
                            </td>
                            <td>
                                <span title="<%=(item.MonthlyFlow) %>">
                                    <%=(item.MonthlyFlow.Length > 100 ? item.MonthlyFlow.Substring(0, 100) + "…" : item.MonthlyFlow)%>
                                </span>
                            </td>
                            <td>
                                <span title="<%=(item.IpRange) %>">
                                    <%=(item.IpRange.Length > 100 ? item.IpRange.Substring(0, 100) + "…" : item.IpRange)%>
                                </span>
                            </td>
                            <td>
                                <span title="<%=(item.UnitPrice) %>">
                                    <%=(item.UnitPrice.Length > 100 ? item.UnitPrice.Substring(0, 100) + "…" : item.UnitPrice)%>
                                </span>
                            </td>
                            <td>
                                <a href="/sankt/USKTS01_0.htm" target="_blank">
                                    <img src="Images/dinggou.jpg" /></a>
                            </td>
                        </tr>
                        <%
                        }
                    }
                        %>
                    </table>
                    <script type="text/javascript">
                        var obj = document.getElementById("table");
                        if (obj != null) {

                            for (var i = 0; i < obj.rows.length; i++) {
                                obj.rows[i].onmouseover = function () { this.style.background = "#FF6600"; }
                                obj.rows[i].onmouseout = function () { this.style.background = ""; }
                            }
                        }
                    </script>
                    <%-- <div class="sblock2-bottom" style="color: #333333;">
                        <%
                                string shouyeUrl = pageIndex > 1 ? string.Format("../room-{0}-{1}.html", m.ID, parid) : "#";
                                string preUrl = pageIndex > 1 ? string.Format("../room-{0}-{1}-{2}.html", m.ID, parid, pageIndex - 1) : "#";
                                string nextUrl = pageIndex < sumPageCount ? string.Format("../room-{0}-{1}-{2}.html", m.ID, parid, pageIndex + 1) : "#";
                                string moyeUrl = pageIndex < sumPageCount ? string.Format("../room-{0}-{1}-{2}.html", m.ID, parid, sumPageCount) : "#";

                                string style = pageIndex == 1 ? "style=\"color:Gray;\"" : "";
                                string style1 = pageIndex == sumPageCount ? "style=\"color:Gray;\"" : "";
                        %>
                        <div class="fenye">
                            <a <%=(style) %> title="首页" href="<%=(shouyeUrl) %>" target="_parent">首页</a> <a <%=(style) %>
                                title="上一页" href="<%=(preUrl) %>" target="_parent">上一页</a> <a <%=(style1) %> title="下一页"
                                    href="<%=(nextUrl) %>" target="_parent">下一页</a> <a <%=(style1) %> title="末页" href="<%=(moyeUrl) %>"
                                        target="_parent">末页</a> <span>当前<%=(datalist.Count) %>条数据 / 每页<%=(pageCount) %>条数据</span>
                            <span>当前第<%=(pageIndex) %>页 / 共<%=(sumPageCount) %>页</span>
                            <div class="clear">
                            </div>
                        </div>
                        <% 
                        }
                        %>
                    </div>--%>
                </div>
            </div>
            <%
                }
            %>
            <div class="sblock2">
                <div class="sblock2-top">
                    <h4 style="font-weight: bold;">
                        <span style="color: #FF6600;">
                            <%=(m.AlternateField2) %></span>
                    </h4>
                </div>
                <div class="sblock2-bottom" id="Div2" style="color: #333333">
                    <%
                        if (string.IsNullOrEmpty(m.Memo) || string.IsNullOrWhiteSpace(m.Memo))
                        {
                            Response.Write("暂无数据");
                        }
                        else
                        {
                            Response.Write(m.Memo);
                        }
                    %>
                </div>
            </div>
        </div>
    </div>
    <div class="clear">
    </div>
</asp:Content>
